package com.liuyucheng.designpattern.代理模式.dynamic.jdk2;

public class TestDynamic {
    public static void main(String[] args) {
        //真实角色
        Host host = new Host();

        ProxyInvocationHandler handler = new ProxyInvocationHandler();
        //通过调用程序处理角色来处理我们要调用的接口对象
        handler.setTarget(host);

        Rent rent = (Rent) handler.getProxy();//动态生成代理类
        rent.rent();
    }
}
